#include <stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    int m = 0,count = 1000000,x = 0,y = 0,z = 0;
    for (int i = 1;i < n/5+1;i++)
    {
        for (int j = 1;j < n/3+1;j++)
        {
            for (int k = 3;k < n*3;k+=3)
            {
                if (i*5 + j*3 +k/3 > n)
                {
                    break;
                }
                if (n == i *5+j*3+k/3)
                {
                    m++;
                    if (i + j+ k < count)
                    {
                        count  = i+j +k;
                        x = i;
                        y = j;
                        z = k;
                    }
                }
            }
        }
    }
    printf("%d\n%d %d %d %d\n",m,count,x,y,z);    return 0;
}